<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
     <script>
         let p = new Promise((resolve, reject)=>{
             // 1、resolve函数
             //  resolve('ok')
             // 2、reject
             // reject('error')
             // 3、抛出错误
             throw new Error('错误');
         })

         console.log(p.catch(reason => {console.log(reason.message)}))
     </script>
</body>
</html>